package com.qf.student.utils2;

import jdk.nashorn.internal.ir.ReturnNode;

/**
 * @version1.0
 * @auth dmh
 */
public class StringUtils {
    /**
     * 验证字符串不为空的方法
     * @param strs
     * @return
     */
    public static boolean isNotEmpty(String...strs){
        for (String str : strs){
           ///如果字符创是空的,就直接返回false
            if( str==null||str.trim().length()==0){
               return false;
           }
        }
        //循环结束都没有返回去,就返回true出去
        return true;
    }
    public static Integer StringToInt(String num){
        try {
            return Integer.valueOf(num);
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return -1;
    }
    public static Double stringToDouble(String num){
        try {
            return Double.valueOf(num);
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return -1.0;
    }
}
